package cn.kshost.zqyg.user.service.impl;

import cn.kshost.zqyg.model.entity.user.UserAddress;
import cn.kshost.zqyg.user.mapper.UserAddressMapper;
import cn.kshost.zqyg.user.service.UserAddressService;
import cn.kshost.zqyg.utils.AuthContextUtil;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class UserAddressServiceImpl implements UserAddressService {
    @Autowired
    UserAddressMapper userAddressMapper;
    @Override
    public List<UserAddress> findUserAddressList() {
        //获取用户id
        Long userId = AuthContextUtil.getUserInfoValue().getId();
        List<UserAddress> userAddressList =  userAddressMapper.selectUserAddressList(userId);
        return userAddressList;
    }

    @Override
    public UserAddress findUserAddressById(Long id) {
        UserAddress userAddress =  userAddressMapper.findUserAddressById(id);
        return userAddress;
    }
}
